package gameModel;


public class StdCase implements Case {
	
	// ATTRIBUTS
	
	private CaseStates state;
	private Piece piece;
	private boolean steel;
	
	// CONSTRUCTEUR
	
	public StdCase(CaseStates t) {
		if (t == null) {
			throw new IllegalArgumentException();
		}
		state = t;
	}
	
	// REQUETES

	@Override
	public CaseStates getCaseState() {
		return state;
	}

	@Override
	public Piece getPiece() {
		return piece;
	}

	@Override
	public boolean isSteel() {
		return steel;
	}
	
	// COMMANDES

	@Override
	public void setCaseState(CaseStates state) {
		if (state == null) {
			throw new IllegalArgumentException();
		}
		if (!state.isWalkable()) {
			piece = null;
		}
		this.state = state;
	}

	@Override
	public void setPiece(Piece p) {
		piece = p;
	}

	@Override
	public void setSteel(boolean steel) {
		this.steel = steel;
	}

}
